"""
进度 | 模型
"""

from pydantic import BaseModel

from models import VOBase
from my_typing import *
from utils.data_utils.special import ObjectIdStr
from utils.mock_utils import Demo
from utils.validator_utils.pydantic_validator.field import (
    CharField,
    IntegerField,
    NormalField,
)


class ProcessHistory(BaseModel):
    """ 进度历史 | Model """

    percent: int = IntegerField(0, title="进度百分比", min_value=0, max_value=100)
    update_time: datetime = NormalField(title="更新时间")


class ProcessBase(VOBase):
    """ 进度 | 基类 """

    process_id: ObjectIdStr = CharField(..., title="进度 ID（ObjectId 字符串）", examples=[Demo.id])
